class Solution:
    def hIndex(self, citations: List[int]) -> int:
        Left = 1
        right = len(citations)

        while Left <= right:
            mid = (Left + right) // 2
            if citations[-mid] >= mid:
                Left = mid + 1
            else:
                right = mid - 1
        return right